define(["config","App"],function(config,App){ 
    var _init = function(path){
        if(!path){
             return App.component(config.default_router);
        }
        var router = config.router;
        for(i in router){
            if(i == path){
                router[i]();
            }else{
                App.component(path);
            }
        }
    }
    return {
        router:function(){
            var path = App.hash("page")?App.hash("page"):App.param("page");
            _init(path);
        },
        load:function(path){ 
            _init(path);
        }
    };
})